﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
    xmlns:local="clr-namespace:Microsoft.ProductivityHub.SilverlightBookshelf"
	mc:Ignorable="d"
	x:Class="Microsoft.ProductivityHub.SilverlightBookshelf.FeaturedContentControl"
	d:DesignWidth="500" d:DesignHeight="330">

	
	<Grid x:Name="LayoutRoot" Margin="16,0,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
		<Grid x:Name="TitleGrid" Margin="2,5,197,0" VerticalAlignment="Top" Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock FontSize="21.333" Foreground="{Binding Path=DarkColorBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}" Text="Featured Content" TextWrapping="NoWrap" VerticalAlignment="Center"/>
    		<Image HorizontalAlignment="Left" Margin="10" Width="25" VerticalAlignment="Center" Source="../Images/hub-sketch-featured1.jpg" Grid.Column="1" Stretch="None"/>
		</Grid>

        <ScrollViewer x:Name="scrollView" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Auto" MouseWheel="ScrollViewer_MouseWheel" 
                      Grid.Row="1" Height="280" BorderBrush="Transparent" Background="#01FFFFFF" Margin="0,0,10,0">


            <ItemsControl x:Name="featuredContentControl">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid Grid.Row="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Image HorizontalAlignment="Left" x:Name="itemIcon" VerticalAlignment="Center" Width="16" 
                                       Source="{Binding Icon}" Stretch="Uniform"/>
                                <TextBlock Margin="5" Cursor="Hand" FontSize="12" Foreground="{Binding Path=LinkColorBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}" 
                                           Text="{Binding Title}" TextWrapping="Wrap" Grid.Column="1" FontFamily="Verdana" VerticalAlignment="Center" 
                                           HorizontalAlignment="Left" MaxWidth="454" MouseLeftButtonDown="Title_MouseLeftButtonDown" Tag="{Binding DocUrl}"/>
                            </Grid>
                            <TextBlock FontSize="10" Foreground="#FF666666" Text="{Binding Abstract}" TextWrapping="Wrap" Grid.Row="1" Grid.RowSpan="2" FontFamily="Verdana" 
                                       HorizontalAlignment="Left" VerticalAlignment="Top" MaxWidth="470"/>
                            <Grid Grid.Row="3">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <TextBlock FontSize="10" Foreground="Black" Text="Rating:" TextWrapping="NoWrap" Grid.Column="0" Margin="0,3,0,0"/>
                                <inputToolkit:Rating HorizontalAlignment="Left" Margin="-9, 0, 0, 0" ItemCount="5" Background="Transparent" Value="{Binding RatingValue}"
                                     IsReadOnly="True" RenderTransformOrigin="0.5,0.5" Grid.Column="1" Foreground="{Binding Path=RatingGradientBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}">
                                    <inputToolkit:Rating.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleY="0.6" ScaleX="0.7"/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </inputToolkit:Rating.RenderTransform>
                                </inputToolkit:Rating>
                                <!-- javascript:hub10_AddFavorite({@ID}) -->
                                <TextBlock FontSize="10" Cursor="Hand" Foreground="{Binding Path=LinkColorBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}" 
                                           Text="Tag as My Favorite" TextWrapping="NoWrap" Grid.Column="2" FontFamily="Verdana" Margin="0,3,0,0" 
                                           MouseLeftButtonDown="TagFavorite_MouseLeftButtonDown" Tag="{Binding DocId}"/>
                            </Grid>

                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

        </ScrollViewer>
    </Grid>
</UserControl>